package com.haiberg.framework.web.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.haiberg.framework.om.Record;
import com.haiberg.framework.services.GenericsClassService;

@Controller
@RequestMapping("/data")
public class DataController {
	@Autowired
	@Qualifier("genericsClassService")
	GenericsClassService<Record> genericsClassService;
	
	@RequestMapping(value="/list")
	public String list(Model model,HttpServletRequest request) throws Exception {
		List<Record> dataList = genericsClassService.findAll("from Record ");
		model.addAttribute("dataList", dataList);
		return "data/list";
	}
}
